package yag.battle.dao;

import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import yag.battle.model.Army;
import yag.battle.model.Horseman;
import yag.battle.model.SwordMan;
import yag.battle.pet.model.Pet;

import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Created by user on 31.08.2014.
 */
@Repository
public class ArmyDao {
    private ConcurrentHashMap<Integer, Army> armyMap;

    public ArmyDao() {
        armyMap = new ConcurrentHashMap<Integer, Army>();
    }

    public Army getArmy(int id) {
        return armyMap.get(id);
    }

    public void addArmy(Army army) {
        this.armyMap.put(army.getId(), army);
    }

    public void deleteArmy(int id) {
        this.armyMap.remove(id);
    }

}
